load("//bazel:tachyon_cc.bzl", "tachyon_cc_library", "tachyon_cc_unittest")

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "constant_expression",
    hdrs = ["constant_expression.h"],
    deps = [
        ":expression",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "evaluator",
    hdrs = ["evaluator.h"],
    deps = [":expression"],
)

tachyon_cc_library(
    name = "expression",
    hdrs = ["expression.h"],
    deps = [
        ":expression_type",
        "//tachyon/base/containers:container_util",
    ],
)

tachyon_cc_library(
    name = "expression_factory",
    hdrs = ["expression_factory.h"],
    deps = [
        ":constant_expression",
        ":negated_expression",
        ":product_expression",
        ":scaled_expression",
        ":sum_expression",
    ],
)

tachyon_cc_library(
    name = "expression_type",
    srcs = ["expression_type.cc"],
    hdrs = ["expression_type.h"],
    deps = ["//tachyon/base:logging"],
)

tachyon_cc_library(
    name = "negated_expression",
    hdrs = ["negated_expression.h"],
    deps = [
        ":expression",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "product_expression",
    hdrs = ["product_expression.h"],
    deps = [
        ":expression",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "scaled_expression",
    hdrs = ["scaled_expression.h"],
    deps = [
        ":expression",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "sum_expression",
    hdrs = ["sum_expression.h"],
    deps = [
        ":expression",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_unittest(
    name = "expression_unittests",
    srcs = [
        "constant_expression_unittest.cc",
        "expression_unittest.cc",
        "negated_expression_unittest.cc",
        "product_expression_unittest.cc",
        "scaled_expression_unittest.cc",
        "sum_expression_unittest.cc",
    ],
    deps = [
        ":expression_factory",
        "//tachyon/math/finite_fields/test:finite_field_test",
        "//tachyon/math/finite_fields/test:gf7",
        "//tachyon/math/polynomials/univariate:univariate_polynomial",
    ],
)
